Adds filters, compressors and serializer props to Array#2652
Conversation
| template += "\nCompressor : {_compressor}" | ||
|
|
||
| if self._filters is not None: | ||
| if len(self._filters) > 0: |
There was a problem hiding this comment.
Will this prevent arrays with no filters at all from displaying the fact that they have no filters via the .info method?
There was a problem hiding this comment.
likely out of scope, since my question is really about the pre-existing behavior of this function
There was a problem hiding this comment.
The "Filters : ... " line wasn't shown if filters was None, but it was shown if filters was (). Now, it is not shown if None or ().
There was a problem hiding this comment.
Don't we want to explicitly show the value of filters, even if it's ()?
There was a problem hiding this comment.
We could. I don't have a strong preference here.
There was a problem hiding this comment.
IMO it's better to show a static set of properties with this function, but if that's annoying to implement here we can defer for a separate PR
There was a problem hiding this comment.
What about "Serializer", which doesn't exist for v2 arrays?
There was a problem hiding this comment.
maybe None there? in principle there's nothing stopping someone from implementing a v2-compatible BytesCodec in numcodecs, in which case we might end up with v2 arrays with a serializer
There was a problem hiding this comment.
Well, there is no place in the v2 metadata for a serializer.
I opted for not showing the serializer field in the Array.info.
d-v-b
left a comment
There was a problem hiding this comment.
happy to see some simplified tests via these changes!
Adds
filters,compressors,serializerproperties to theArrayandAsyncArrayclasses. These properties mirror the kwargs that users provide increate_array, i.e. inner codecs in sharding are surfaced.Array.infois adapted accordingly. Fixes #2633 #2649.I also fixed a bug where strings/bytes dtypes couldn't be used with sharding due to validation errors.
TODO: